package it.uniba.di.collab.jazzfeed.service;

import it.uniba.di.collab.jazzfeed.common.model.Room;
import it.uniba.di.collab.jazzfeed.common.model.User;

import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.repository.common.UUID;
import com.ibm.team.repository.service.AbstractRepositoryComponentInitializer;
import com.ibm.team.repository.service.IRepositoryInitializerContext;

public class JazzFeedInitializer extends AbstractRepositoryComponentInitializer {

	@Override
	public void initializeNewRepository(
			IRepositoryInitializerContext initializerContext)
			throws TeamRepositoryException {
		UUID uuid = UUID.generate();
		User usr = (User) JazzFeedService.getUserItemType().createItem();
		usr.setLogin("Davide");
		usr.setPassword("pippo");
		initializerContext.addNewSimpleItem(usr, uuid);
		Room room = (Room) JazzFeedService.getUserItemType().createItem();
		room.setNome("JazzFeed");
		room.setUrl("http://www.friendfeed.com/rooms/jazzfeed");
		initializerContext.addNewSimpleItem(room, uuid);
	}

}
